package com.example.aiagent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.aiagent.model.entity.FilesVector;
import com.example.aiagent.service.FilesVectorService;
import com.example.aiagent.mapper.FilesVectorMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
* @author wu
* @description 针对表【files_vector(图片)】的数据库操作Service实现
* @createDate 2025-08-22 17:31:41
*/
@Service
public class FilesVectorServiceImpl extends ServiceImpl<FilesVectorMapper, FilesVector>
    implements FilesVectorService{

    @Resource
    private FilesVectorMapper filesVectorMapper;

    @Override
    public List<String> getFilesUrl() {
        QueryWrapper<FilesVector> QueryWrapper = new QueryWrapper<>();
        QueryWrapper.eq("isDelete", 0);
        List<FilesVector> filesVectors = filesVectorMapper.selectList(QueryWrapper);
        List<String> filesUrl = new ArrayList<>();
        for (FilesVector filesVector : filesVectors) {
            String url = filesVector.getUrl();
            filesUrl.add(url);
        }
        return filesUrl;
    }
}




